<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="UTF-8" />
	<title>修改</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <link th:href="@{/static/css/right4.css}" rel="stylesheet">
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

	<div class="container bg-white">
       <div class="row">
        <div class="col-md-8 col-md-offset-2  col-xs-8 col-xs-offset-2   col-lg-8 col-lg-offset-2 ">
             <br>
            <form class="form-horizontal" th:action="@{'/membership/update/'+${currentPage}}" th:object="${membership}" method="post">
            	<input type="hidden" id="id" name="id" th:value="${membership.id}" />
             <br>
             	<div style="border-left:#3399FF solid 2px; padding:10px;"><h4>修改会员信息</h4></div>
                <hr>
                 <div class="form-group">
                    <label for="" class="col-sm-3 control-label"> 会员的名称</label>
                    <div class="col-sm-7">
                    <input type="text" class="form-control" name="name" id="name" th:value="${membership.name}"/>
                    </div>
                  </div>	
                 <div class="form-group">
                    <label for="" class="col-sm-3 control-label"> 会员的年龄</label>
                    <div class="col-sm-7">
                    	<input type="text" class="form-control" name="age" id="age" th:value="${membership.age}"/>
                    </div>
                  </div>	
                  <div class="form-group" th:switch="${membership.gender}">
                    	<label for="" class="col-sm-3 control-label">性别 </label>
                    	<div class="col-sm-8" th:case="1">
	                      <label class="checkbox-inline">
	                          <input type="radio" name="gender" id="gender" value="1" checked="checked"> 男
	                        </label>
	                        <label class="checkbox-inline">
	                          <input type="radio" id="gender" name="gender" value="2"> 女
	                        </label>      
	                    </div>
                    	<div class="col-sm-8" th:case="2">
	                      <label class="checkbox-inline">
	                          <input type="radio" name="gender" id="gender" value="1"> 男
	                        </label>
	                        <label class="checkbox-inline">
	                          <input type="radio" id="gender" name="gender" value="2" checked="checked"> 女
	                        </label>      
	                    </div>
                  </div>
              	<div class="form-group">
                    <label for="" class="col-sm-3 control-label">电话 </label>
                    <div class="col-sm-7">
                    	<input type="text" class="form-control" name="tel" id="tel" th:value="${membership.tel}"/>
                    </div>
                  </div>
              	<div class="form-group">
                    <label for="" class="col-sm-3 control-label">email </label>
                    <div class="col-sm-7">
                    	<input type="text" class="form-control" name="email" id="email" th:value="${membership.email}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">公司</label>
                    <div class="col-sm-7">
                  	   <input type="text" class="form-control" name="company" id="company" th:value="${membership.company}"/>
                    </div>
                  </div>
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">会员等级</label>
                    <div class="col-sm-7">
                    <select class="form-control" id="level_id" name="level_id">
	                    <option th:each="var : ${levelList}" th:value="${var.id}" th:text="${var.levelName}" th:selected="${membership.level_id==var.id}">Thymus Thymi</option>
	                </select>
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label for="" class="col-sm-3 control-label">家庭住址</label>
                    <div class="col-sm-7">
                    <input type="text" class="form-control" name="address" id="address" th:value="${membership.address}"/>
                    </div>
                  </div>
                  <div class="form-group" th:if="${session.user.membership_id eq null}">
                    <label for="" class="col-sm-3 control-label">所剩次数</label>
                    <div class="col-sm-7">
                    	<input type="text" class="form-control" name="leftTimes" id="leftTimes" th:value="${membership.leftTimes}"/>
                    </div>
                  </div>
                  <div class="form-group" th:if="${session.user.membership_id eq null}">
                    <label for="" class="col-sm-3 control-label">已经健身次数</label>
                    <div class="col-sm-7">
                    	<input type="text" class="form-control" name="fitnessNumber" id="fitnessNumber" th:value="${membership.fitnessNumber}"/>
                    </div>
                  </div>
                  <div class="form-group" th:switch="${membership.audit}">
                  		<label for="" class="col-sm-3 control-label">审核状态 </label>
					    <div class="col-sm-7" th:case="1">
					    	<label class="checkbox-inline">
	                          <input type="radio" id="audit" name="audit" value="0"> 审核中
	                        </label> 
					    	<label class="checkbox-inline">
	                          <input type="radio" id="audit" name="audit" value="1" checked="checked"> 审核通过
	                        </label> 
					    </div>
					    <div class="col-sm-10" th:case="0">
					    	  <label class="checkbox-inline">
		                          <input type="radio" id="audit" name="audit" value="0" checked="checked"> 审核中
		                        </label> 
						    	<label class="checkbox-inline">
		                          <input type="radio" id="audit" name="audit" value="1"> 审核通过
		                        </label> 
					    </div>
					  </div>
                <div class="form-group">    
                 <br>
                    <div class="col-sm-1 col-sm-offset-7 ">  
                    <button type="submit" class="btn btn-primary">取消</button>
                    </div>
                    <div class="col-sm-1 col-sm-offset-1 ">
                    <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </div>
              </form>    
       	</div>
       </div>      
	</div>

	<!-- <form th:action="@{'/membership/update/'+${currentPage}}" th:object="${membership}" method="post">
		<input type="hidden" id="id" name="id" th:value="${membership.id}" />
		<table id="table-1">
			<thead>
				<tr>
					<th>名称</th>
					<th>年龄</th>
					<th>性别</th>
					<th>电话</th>
					<th>公司</th>
					<th>会员级别</th>
					<th>家庭住址</th>
					<th>剩余次数</th>
					<th>健身次数</th>
					<th>审核状态</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>
						<input type="text" name="name" id="name" th:value="${membership.name}"/>
					</td>
					<td><input type="text" name="age" id="age" th:value="${membership.age}"/></td>
					<td>
					<div class="form-group" th:switch="${membership.gender}">
					    <div class="col-sm-10" th:case="1">
							  <input type="radio" name="gender" id="gender" value="2"/> 女
							  <input type="radio" name="gender" id="gender" value="1" checked="checked"/> 男
					    </div>
					    <div class="col-sm-10" th:case="2">
							  <input type="radio" name="gender" id="gender" value="2" checked="checked"/> 女
							  <input type="radio" name="gender" id="gender" value="1"/> 男
					    </div>
					  </div>
					</td>
					<td><input type="text" name="tel" id="tel" th:value="${membership.tel}"/></td>
					<td><input type="text" name="company" id="company" th:value="${membership.company}"/></td>
					<td>
						<select id="type_id" name="type_id" class="form-control select select-default mrs mbm" disabled="disabled" >
		                    <option th:each="var : ${eqTypeList}" th:value="${var.id}" th:text="${var.name}" th:selected="${equipment.type_id==var.id}" >Thymus Thymi</option>
		                </select>
		                <select id="level_id" name="level_id" class="form-control select select-default mrs mbm" >
		                    <option th:each="var : ${levelList}" th:value="${var.id}" th:text="${var.levelName}" th:selected="${membership.level_id==var.id}">Thymus Thymi</option>
		                </select>
					</td>
					<td><input type="text" name="address" id="address" th:value="${membership.address}"/></td>
					<td><input type="text" name="leftTimes" id="leftTimes" th:value="${membership.leftTimes}"/></td>
					<td><input type="text" name="fitnessNumber" id="fitnessNumber" th:value="${membership.fitnessNumber}"/></td>
					<td>
						<div class="form-group" th:switch="${membership.audit}">
					    <div class="col-sm-10" th:case="1">
							  <input type="radio" name="audit" id="audit" value="0"/> 审核中
							  <input type="radio" name="audit" id="audit" value="1" checked="checked"/> 通过
					    </div>
					    <div class="col-sm-10" th:case="2">
							  <input type="radio" name="audit" id="audit" value="0" checked="checked"/> 审核中
							  <input type="radio" name="audit" id="audit" value="1"/> 通过
					    </div>
					  </div>
					</td>
				</tr>
			</tbody>
		</table>
		<button type="submit">修改</button>		
	</form> -->
	<script th:src="@{/static/js/jquery-2.1.4.js}"></script>
</body>
</html>